//
//  RecommendCollectionViewCell.m
//  JiuJiuShangCheng
//
//  Created by jiujiukeji on 2018/7/30.
//  Copyright © 2018年 jiujiukeji. All rights reserved.
//

#import "RecommendCollectionViewCell.h"

@implementation RecommendCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setUpUI];
    }
    return self;
}
- (void)setUpUI
{
    self.goodsImg = [[UIImageView alloc] init];
    _goodsImg.layer.masksToBounds = YES;
    _goodsImg.layer.borderColor = lineGray.CGColor;
    _goodsImg.layer.borderWidth = 0.5;
    [self addSubview:_goodsImg];
    [_goodsImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self).offset(rateWidth(15));
        make.size.mas_offset(CGSizeMake(rateWidth(220), rateWidth(220)));
    }];
    
    self.titleLB = [UILabel labelWithText:@"商品尚品商品商品商品" textColor:UIColorFromRGB(0x666666) fontSize:14];
    [_titleLB sizeToFit];
    [self addSubview:_titleLB];
    [_titleLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.goodsImg);
        make.top.equalTo(self.goodsImg.mas_bottom).offset(rateWidth(15));
        make.width.mas_lessThanOrEqualTo(rateWidth(220));
    }];
    
    self.priceLB = [UILabel labelWithText:@"￥300.00" textColor:navBarColor fontSize:14];
    [_priceLB sizeToFit];
    [self addSubview:_priceLB];
    [_priceLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.goodsImg);
        make.top.equalTo(self.titleLB.mas_bottom).offset(rateWidth(10));
    }];
    
}

@end
